<template>
    <view>
        <u-input ref="input" v-model="content" placeholder="请输入内容" :border="true" clearable />
        <u-button type="primary" @click="addItem" :color="content ? $u.color.primary : $u.color.info">ADD</u-button>
    </view>
</template>

<script setup lang="js">
import { Component, Vue, Emit, Ref } from 'vue-property-decorator';

@Component
export default class Add extends Vue {
    content = ''
    @Ref() input;

    @Emit()
    addItem() {
        requestAnimationFrame(() => {
            this.content = ''
            console.log(this.input)
        });

        return this.content
    }
}
</script>

<style lang="" scoped>

</style>


